import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "BBSHeader",
    component: () => import(/* webpackChunkName: "about" */ "../views/BBSHeader.vue"),
    children: [
      {
        path: "/",
        name: "首页",
        component: () => import("../views/home/index")
      },
      {
        path: "/my",
        name: "我的主页",
        component: () => import("../views/my/index")
      },
      {
        path: "/community",
        name: "社区",
        component: () => import("../views/community/index")
      },
      {
        path: "/mv",
        name: "MV",
        component: () => import("../views/mv/index")
      },
      {
        path: "/vip",
        name: "VIP",
        component: () => import("../views/vip/index")
      },
      {
        path: "/download",
        name: "download",
        component: () => import("../views/download/index")
      },
      {
        path: "/upload",
        name: "upload",
        component: () => import("../views/upload/index")
      },
      {
        path: "/mylist",
        name: "我的歌单",
        component: () => import("../views/my/List")
      },
      {
        path: "/buy/songs",
        name: "SongsBuy",
        component: ()=> import("../views/buy/songs"),
      },
      {
        path: "/buy/vip",
        name: "VIPBuy",
        component: ()=> import("../views/buy/vip"),
      },
    ],
  },
  {
    path: "/login",
    name: "登录",
    component: () => import("../views/login/Login")
  },
  {
    path: "/wxlogin",
    name: "微信登录",
    component: () => import("../views/login/weixinLogin")
  },
  {
    path: "/retrieve",
    name: "修改密码",
    component: () => import("../views/login/Retrieve")
  },
  {
    path: "/register",
    name: "账户注册",
    component: () => import("../views/login/Register")
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
